local sk__sanzhi = fk.CreateSkill {

  name = "sk__sanzhi",

  tags = {  },

}



sk__sanzhi:addEffect(fk.CardUseFinished, {
  name = "sk__sanzhi",
  anim_type = "special",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(sk__sanzhi.name) and #player:getTableMark(sk__sanzhi.name) == 3 then
      player.room:setPlayerMark(player, sk__sanzhi.name, 0)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:doIndicate(player.id, table.map(room:getOtherPlayers(player), Util.IdMapper))
    for _, p in ipairs(room:getOtherPlayers(player)) do
      room:addPlayerMark(p, "@sk__taiping", 1)
    end
  end,
})
sk__sanzhi:addEffect(fk.CardUseFinished, {
  can_refresh = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk__sanzhi.name, true)
  end,
  on_refresh = function(self, event, target, player, data)
    local mark = player:getTableMark(sk__sanzhi.name)
    table.insertIfNeed(mark, data.card.type)
    player.room:setPlayerMark(player, sk__sanzhi.name, mark)
  end,
})

return sk__sanzhi